import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { HomeMediaService } from './home-media.service';
import { CreateHomeMediaDto } from './dto/create-home-media.dto';
import { UpdateHomeMediaDto } from './dto/update-home-media.dto';
import { Public } from 'src/auth/utils/public.metadata';

@Controller('home-media')
export class HomeMediaController {
  constructor(private readonly homeMediaService: HomeMediaService) {}

  @Post()
  create(@Body() createHomeMediaDto: CreateHomeMediaDto) {
    return this.homeMediaService.create(createHomeMediaDto);
  }

  @Public()
  @Get()
  findAll() {
    return this.homeMediaService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.homeMediaService.findOne(+id);
  }

  @Patch(':id')
  update(
    @Param('id') id: string,
    @Body() updateHomeMediaDto: UpdateHomeMediaDto,
  ) {
    return this.homeMediaService.update(+id, updateHomeMediaDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.homeMediaService.remove(+id);
  }
}
